package com.lantosec.hmrp.modules.internal.entity;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.internal.vo.InternalTaskDetailVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 评价任务明细 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InternalTaskDetail extends BaseEntity<InternalTaskDetailVO> {

    private static final long serialVersionUID = 1L;
    public InternalTaskDetail(InternalTaskDetailVO vo){
        this.internalTaskDetailId = vo.getInternalTaskDetailId();
        this.internalTaskId = vo.getInternalTaskId();
        this.internalPlanId = vo.getInternalPlanId();
        this.internalPlanType = vo.getInternalPlanType();
        this.executorMode = vo.getExecutorMode();
        this.executorDeptId = vo.getExecutorDeptId();
        this.executorPositionId = vo.getExecutorPositionId();
        this.executorUserId = vo.getExecutorUserId();
        this.targetMode = vo.getTargetMode();
        this.targetDeptId = vo.getTargetDeptId();
        this.targetPositionId = vo.getTargetPositionId();
        this.targetUserId = vo.getTargetUserId();
        this.finished = vo.getFinished();
    }

    @Override
    public InternalTaskDetailVO convertToVO(){
        return new InternalTaskDetailVO(this);
    }


    /**
     * 评价任务明细ID
     */
    @TableId(value = "internal_task_detail_id", type = IdType.AUTO)
    private Integer internalTaskDetailId;

    /**
     * 评价任务ID
     */
    private Integer internalTaskId;

    /**
     * 评价方案ID
     */
    private Integer internalPlanId;

    /**
     * 方案类型
     */
    private Integer internalPlanType;

    /**
     * 评价方形式
     */
    private Integer executorMode;

    /**
     * 评价方ID（部门）
     */
    private String executorDeptId;

    /**
     * 评价方ID（岗位）
     */
    private String executorPositionId;

    /**
     * 评价人ID
     */
    private String executorUserId;

    /**
     * 被评价方形式
     */
    private Integer targetMode;

    /**
     * 被评价方ID(部门)
     */
    private String targetDeptId;

    /**
     * 被评价方ID(岗位)
     */
    private String targetPositionId;

    /**
     * 被评价方ID(人员)
     */
    private String targetUserId;

    /**
     * 是否完成评价(0否 1是)
     */
    private Integer finished;


    public enum ColName {
        internal_task_detail_id, internal_task_id, internal_plan_id, internal_plan_type, executor_mode, executor_dept_id, executor_position_id, executor_user_id, target_mode, target_dept_id, target_position_id, target_user_id, finished,
    }
}
